package com.huajx.tuopuda.client.udp.codec.auth;

import com.huajx.tuopuda.client.udp.TuopudaDirect;

import java.util.Date;

/**
 * 9.2.3.8.4添加或修改权限[1107] (此指令只适合1000个权限内的操作)
 *
 * @author: lisa 叶新华
 * @create: 2019-09-28 05:32
 */
public class AddOrUpdateAuthCodec extends AppendAuthCodec {

    private int function = TuopudaDirect.D_1107;

    protected AddOrUpdateAuthCodec(int sn) {
        super(sn);
        setFunction(function);
    }

    private AddOrUpdateAuthCodec(int sn, int cardId, int index) {
        super(sn, cardId, index);
    }

    private AddOrUpdateAuthCodec(int sn, int cardId, int index, Date start, Date end, int password) {
        super(sn, cardId, index, start, end, password);
    }

    public static AddOrUpdateAuthCodec getInstance(int sn, int cardId, int index) {
        return new AddOrUpdateAuthCodec(sn, cardId, index);
    }

    public static AddOrUpdateAuthCodec getInstance(int sn, int cardId, int index, Date start, Date end, int password) {
        return new AddOrUpdateAuthCodec(sn, cardId, index, start, end, password);
    }

}
